package com.mmd.common.enums;

import java.util.Objects;

public enum UserTypeEnums {
    USER(1, "用户"),
    SUP(0, "供应商");

    private UserTypeEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static UserTypeEnums getUserTypeEnum(Integer code) {
        UserTypeEnums[] enumArr = UserTypeEnums.values();
        for (UserTypeEnums e : enumArr) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return null;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
